<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>DMDirc :: Admin</title>
  <link rel="stylesheet" type="text/css" href="/res/style.css">
 </head>
 <body>
  <div id="container">
   <img id="logo" src="/res/logo.png" alt="DMDirc logo">
   <h1>DMDirc</h1>
<?PHP require_once('admin-menu.php'); ?>
   <div id="content">
    <h2>Site Update</h2>
<?php
	$command = '/usr/bin/svn';
//	$command .= ' checkout http://dmdirc.googlecode.com/svn/website/ .';
	$command .= ' update';
	$command .= ' 2>&1';

	chdir('/home/dmdirc/www');

	exec($command,$output);
	echo "<pre>";
	echo implode("\n", $output);
	echo "</pre>";

	echo "<hr>";

	echo "Chmodding files ... "; flush();
	exec("chmod -Rf 755 ./*",$output2);
        echo "Done.<br>";
	echo "<hr>";

	$command  = '/usr/bin/svn';

	if (!is_dir('/home/dmdirc/wiki')) {
		mkdir('/home/dmdirc/wiki');
	}
	if (!is_dir('/home/dmdirc/wiki/.svn')) {
		$command .= ' checkout http://dmdirc.googlecode.com/svn/wiki/ .';
	} else {
		$command .= ' update';
	}

	$command .= ' 2>&1';

	chdir('/home/dmdirc/wiki');

	exec($command, $output3);
	echo '<pre>';
	echo implode("\n", $output3);
	echo '</pre>';
?>
   </div>
   <div id="footer">
   </div>
  </div>
 </body>
</html>

